package org.example.domain.strategy.service.rule.chain.impl;

import lombok.extern.slf4j.Slf4j;
import org.example.domain.strategy.service.armory.IStrategyDispatch;
import org.example.domain.strategy.service.rule.chain.AbstractLogicChain;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Slf4j
@Component("default")
public class DefaultLogicChain extends AbstractLogicChain {
    @Resource
    IStrategyDispatch strategyDispatch;
    @Override
    public String ruleModel() {
        return null;
    }

    @Override
    public Long logic(Long userId, Long strategyId) {
        log.info("正进行默认抽奖。。。。userId：{}  strategyId：{}", userId, strategyId);
        Long awardId =  strategyDispatch.getRandomStrategyAwardId(strategyId);
        log.info("默认抽奖返回。。。。awardId：{}", awardId);
        return awardId;
    }
}
